<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class RecordLastActivedTime
{
    public function handle($request, Closure $next)
    {
        //如果是登录用户的话
        if(Auth::check()){
            Auth::user()->recordLastActivedAt();
        }
        return $next($request);
    }
}
